
*** Civilized Barbarism Do file ***

* All analyses run on MacBook Air with State/BE 17.0 * 

** FOR THE MAIN PAPER **

* create Figure 1 — frequency by decade * 

* both interstate and colonial wars have multiple state participants, so to calculate number of new wars per decade, count the number of new unique WarID numbers reported in left hand column of each decade tab readout. *
tab warid if colonial==0 & decade==1
tab warid if colonial==0 & decade==2
tab warid if colonial==0 & decade==3
tab warid if colonial==0 & decade==4
tab warid if colonial==0 & decade==5
tab warid if colonial==0 & decade==6
tab warid if colonial==0 & decade==7
tab warid if colonial==0 & decade==8
tab warid if colonial==0 & decade==9
tab warid if colonial==0 & decade==10
tab warid if colonial==0 & decade==11
tab warid if colonial==0 & decade==12
tab warid if colonial==0 & decade==13
tab warid if colonial==0 & decade==14
tab warid if colonial==0 & decade==15
tab warid if colonial==0 & decade==16
tab warid if colonial==0 & decade==17
tab warid if colonial==0 & decade==18
tab warid if colonial==0 & decade==19
tab warid if colonial==0 & decade==20

tab warid if colonial==1 & decade==1
tab warid if colonial==1 & decade==2
tab warid if colonial==1 & decade==3
tab warid if colonial==1 & decade==4
tab warid if colonial==1 & decade==5
tab warid if colonial==1 & decade==6
tab warid if colonial==1 & decade==7
tab warid if colonial==1 & decade==8
tab warid if colonial==1 & decade==9
tab warid if colonial==1 & decade==10
tab warid if colonial==1 & decade==11
tab warid if colonial==1 & decade==12
tab warid if colonial==1 & decade==13
tab warid if colonial==1 & decade==14
tab warid if colonial==1 & decade==15
tab warid if colonial==1 & decade==16
tab warid if colonial==1 & decade==17
tab warid if colonial==1 & decade==18
tab warid if colonial==1 & decade==19
tab warid if colonial==1 & decade==20

* counts used to generate data in Sheet2 and Chart1 in excel file (see macdonald_colonialviolence(excel).xlsx)*

* create Table 1 — descriptive statistics
* summary statistics for Downes and Valentino comparisons (far left and far right columns). Morrow replication data (middle columns) found in other file*

summ civtargetcap if colonial==1
summ civtargetcap if colonial==1 & century==0
summ civtargetcap if colonial==1 & century==1

summ civtargetcap if colonial==0
summ civtargetcap if colonial==0 & century==0
summ civtargetcap if colonial==0 & century==1

summ masskill if colonial==1
summ masskill if colonial==1 & century==0
summ masskill if colonial==1 & century==1

summ masskill if colonial==0
summ masskill if colonial==0 & century==0
summ masskill if colonial==0 & century==1

ttest civtargetcap, by(colonial) unequal
ttest civtargetcap if century==0, by(colonial) unequal 
ttest civtargetcap if century==1, by(colonial) unequal 

ttest masskill, by(colonial) unequal
ttest masskill if century==0, by(colonial) unequal 
ttest  masskill if century==1, by(colonial) unequal 

* MAIN MODELS  *

* Model 1 — colonial only, no controls *
logit civtarget warstrat comident setcolon indirectcolon if colonial==1, robust cluster(warid)
eststo model1

* Model 2 — colonial only, with controls * 
logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
eststo model2

* Model 3 — country fixed effects *

* alternative code
* xtset ccode
* xtlogit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, fe

clogit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, group(ccode)
eststo model3

* Model 4 — region fixed effects * 

* alternative code
* xtset region
* xtlogit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, fe

clogit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, group(region)
eststo model4

* Model 5 — country and region fixed effects * 

* alternative code
* xtset ccode
* xtlogit civtarget warstrat comident  setcolon directnoset2 waraims lawshare democ7 milprof capstate logdur namerica samerica meast africa asia europe if colonial==1, fe

clogit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur namerica samerica meast africa asia if colonial==1, group(ccode)
eststo model5

* Generate Table 2 *

esttab model1 model2 model3 model4 model5, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)
esttab model1 model2 model3 model4 model5 using table1.tex, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)

* Generate Figure 2 *

logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
sum warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if e(sample)==1

logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
margins, at(warstrat=(0 1) comident=(1) indirectcolon=(1) waraims=(1) democ7=(0)) atmeans post
eststo strategy 

logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
margins, at(comident=(0 1) warstrat=(0) indirectcolon=(1) waraims=(1) democ7=(0)) atmeans post
eststo culture

logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
margins, at(setcolon=(0 1) comident=(1) warstrat=(0) indirectcolon=(0) waraims=(1) democ7=(0)) atmeans post
eststo settler

logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
margins, at(indirectcolon=(0 1) comident=(1) warstrat=(0) setcolon=(0) waraims=(1) democ7=(0)) atmeans post
eststo indirect

coefplot strategy, bylabel("(a) Wartime Strategy") || culture, bylabel("(b) Combatant Identity") vertical citype(logit) scheme(s2mono) ytitle("Predicted Prob. of Civilian Victimization") ylabel(0(0.2)1) yscale(range(0(0.2)1))
addplot 1: , xlabel(1 "Conventional" 2 "Guerrilla") norescaling
addplot 2: , xlabel(1 "Similar" 2 "Different")  norescaling

coefplot settler, bylabel("(c) Settler Colony") || indirect, bylabel("(d) Indirect Rule Colony") vertical citype(logit) scheme(s2mono) ytitle("Predicted Prob. of Civilian Victimization") ylabel(0(0.2)1) yscale(range(0(0.2)1))
addplot 1: , xlabel(1 "No" 2 "Yes") norescaling
addplot 2: , xlabel(1 "No" 2 "Yes")  norescaling


* ROBUSTNESS CHECKS *

* Model 6 — post 17*
logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur post17 if colonial==1, robust cluster(warid)
eststo model6

* Model 7 — post 45*
logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur post45 if colonial==1, robust cluster(warid)
eststo model7

* Model 8 — interaction with strategy*
* alternative code
* logit civtarget i.warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur i.post17 i.post17#i.warstrat if colonial==1, robust cluster(warid)
generate post17warstrat=post17*warstrat 
la var "Interaction term for post17 and warstrat"
logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur post17 post17warstrat if colonial==1, robust cluster(warid)
eststo model8

* generate Table 3 *

esttab model6 model7 model8, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)
esttab model6 model7 model8 using table2.tex, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)

** FOR THE APPENDIX ** 

* create Appendix Table 2 — descriptive statistics *

summ civtarget waraims warstrat comident setcolon indirectcolon lawshare democ7 milprof capstate logdur if colonial==1

* create Appendix Table 3 — full results for main models * 

* Model 9 — colonial only, no controls *
logit civtarget warstrat comident setcolon indirectcolon if colonial==1, robust cluster(warid)
eststo model9

* Model 10 — colonial only, with controls * 
logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
eststo model10

* Model 11 — country fixed effects *
clogit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, group(ccode)
eststo model11

* Model 12 — region fixed effects * 
clogit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, group(region)
eststo model12

* Model 13 — country and region fixed effects * 
clogit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur namerica samerica meast africa asia if colonial==1, group(ccode)
eststo model13

esttab model9 model10 model11 model12 model13, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)
esttab  model9 model10 model11 model12 model13 using table2.tex, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)

* create Appendix Figure 1 — cumulative marginal effects * 

logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
margins, at(indirectcolon=(0) comident=(1) warstrat=(1) setcolon=(1) waraims=(1) democ7=(0)) atmeans post
eststo value1

logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
margins, at(indirectcolon=(0) comident=(0) warstrat=(0) setcolon=(1) waraims=(1) democ7=(0)) atmeans post
eststo value2

coefplot value1, bylabel(`" "Guerrilla War," "Racialized Adversary," "Settler Colony" "') || value2, bylabel(`" "Conventional War," "Non-Racialized Adversary," "Direct Rule Colony" "') vertical scheme(s2mono) ytitle("Predicted Prob. of Civilian Victimization") citype(logit) ylabel(0(0.2)1) yscale(range(0(0.2)1)) xlabel("")

* create Appendix Table 4 — Robustness checks — 

* create Table 4 — Robustness checks — alternative codings *
* Model 14 — alternative wartime strategy * 
logit civtarget conventional guerrilla comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
eststo model14
* margins, at(conventional=(0 1) guerrilla=(0)) atmeans* 
* Model 15 & 16 — alterantive military professionalism *
logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 miledu capstate logdur  if colonial==1, robust cluster(warid)
eststo model15
logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 draft capstate logdur if colonial==1, robust cluster(warid)
eststo model16
* Model 17 — alternative democracy *
logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare vdemlibdem milprof capstate logdur if colonial==1, robust cluster(warid)
eststo model17
* Model 18 — alternative law measures *
logit civtarget warstrat comident  setcolon indirectcolon waraims lawdich democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
eststo model18

esttab model14 model15 model16 model17 model18, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)
esttab model14 model15 model16 model17 model18 using table3.tex, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)

* create Appendix Table 5 — Robustness checks — sample issues * 

* potential biases in the sample * 
* Model 19 — uk dummy * 
logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur uk if colonial==1, robust cluster(warid)
eststo model19
* Model 20 — control for contiguous cases * 
logit civtarget warstrat comident  setcolon  indirectcolon waraims lawshare democ7 milprof capstate logdur overseas if colonial==1 , robust cluster(warid)
eststo model20
* Model 21 — control for distance * 
logit civtarget warstrat comident setcolon  indirectcolon waraims lawshare democ7 milprof capstate logdur distance if colonial==1 , robust cluster(warid)
eststo model21

esttab model19 model20 model21, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)
esttab  model19 model20 model21 using table4.tex, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)

* distance interaction models
* not reported in the appendix * 
logit civtarget i.warstrat comident setcolon  indirectcolon waraims lawshare democ7 milprof capstate logdur c.distance i.warstrat#c.distance if colonial==1 , robust cluster(warid)
logit civtarget warstrat i.comident setcolon  indirectcolon waraims lawshare democ7 milprof capstate logdur c.distance i.comident#c.distance if colonial==1 , robust cluster(warid)
logit civtarget warstrat comident i.setcolon  indirectcolon waraims lawshare democ7 milprof capstate logdur c.distance i.setcolon#c.distance if colonial==1 , robust cluster(warid)
logit civtarget warstrat comident setcolon i.indirectcolon waraims lawshare democ7 milprof capstate logdur c.distance i.indirectcolon#c.distance if colonial==1 , robust cluster(warid)

*alternative configurations of independent variables*
* create Table 6 — Robustness checks — alternative model specificaitons * 

* Model 22 — strategy only * 
logit civtarget warstrat waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
eststo model22
* Model 23 — identity only *  
logit civtarget comident waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
eststo model23
* Model 24 — institutions only *
logit civtarget setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur if colonial==1, robust cluster(warid)
eststo model24
* Model 25 — only geosrtategic control variables * 
logit civtarget warstrat comident setcolon indirectcolon waraims capstate logdur if colonial==1, robust cluster(warid)
eststo model25
* Model 26 — only geostrategic and regime type control variables*
logit civtarget warstrat comident setcolon indirectcolon waraims capstate democ7 logdur if colonial==1, robust cluster(warid)
eststo model26
esttab model22 model23 model24 model25 model26, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)
esttab model22 model23 model24 model25 model26 using table5.tex, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)
  
* temporal robust checks *

* post 1899*
* not reported in appendix*
logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur post1899 if colonial==1, robust cluster(warid)
* post 17*
logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur post17 if colonial==1, robust cluster(warid)
* post 45*
logit civtarget warstrat comident setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur post45 if colonial==1, robust cluster(warid)

* create Table 7 — temporal interaciton terms *

* Model 27 — Interaction with strategy *
logit civtarget i.warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur i.post17 i.post17#i.warstrat if colonial==1, robust cluster(warid)
eststo model27
* Model 28 — Interaction with war aims *
logit civtarget warstrat comident setcolon indirectcolon i.waraims lawshare democ7 milprof capstate logdur i.post17 i.post17#i.waraims if colonial==1, robust cluster(warid)
eststo model28
* Model 29 — Interaction with military professionalism * 
logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 c.milprof capstate logdur i.post17 i.post17#c.milprof if colonial==1, robust cluster(warid)
eststo model29

esttab model27 model28 model29, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)
esttab model27 model28 model29 using table6.tex, cells(b(star fmt(3)) se(par fmt(2))) stats(pr2 N) star (+ 0.1 * 0.05 ** 0.01 *** 0.001)

* Generate Figure 2* 
* figure 2a — warstrat * 
logit civtarget i.warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur i.post17 i.post17#i.warstrat if colonial==1, robust cluster(warid)
margins, at(warstrat=(0 1) comident=(1) indirectcolon=(1) waraims=(1) democ7=(0) post17=(0)) atmeans post
eststo warstratpre17
logit civtarget i.warstrat comident  setcolon indirectcolon waraims lawshare democ7 milprof capstate logdur i.post17 i.post17#i.warstrat if colonial==1, robust cluster(warid)
margins, at(warstrat=(0 1) comident=(1) indirectcolon=(1) waraims=(1) democ7=(0) post17=(1)) atmeans post
eststo warstratpost17

coefplot warstratpre17, bylabel(Pre-1917)  || warstratpost17, bylabel(Post-1917) vertical scheme(s2mono) ytitle("Predicted Prob. of Civilian Victimization") citype(logit) ylabel(0(0.2)1) yscale(range(0(0.2)1)) byopts(title("(a) Wartime Strategy Temporal Interactions"))
addplot 1: , xlabel(1 "Conventional" 2 "Guerrilla") norescaling
addplot 2: , xlabel(1 "Conventional" 2 "Guerrilla") norescaling

* figure 2b — waraimsation * 
logit civtarget warstrat comident setcolon indirectcolon i.waraims lawshare democ7 milprof capstate logdur i.post17 i.post17#i.waraims if colonial==1, robust cluster(warid)
margins, at(waraims=(0 1) warstrat=(0) comident=(1) indirectcolon=(1) democ7=(0) post17=(0)) atmeans post
eststo waraimspre17
logit civtarget warstrat comident setcolon indirectcolon i.waraims lawshare democ7 milprof capstate logdur i.post17 i.post17#i.waraims if colonial==1, robust cluster(warid)
margins, at(waraims=(0 1) warstrat=(0) comident=(1) indirectcolon=(1)  democ7=(0) post17=(1)) atmeans post
eststo waraimspost17

coefplot waraimspre17, bylabel(Pre-1917)  || waraimspost17, bylabel(Post-1917) vertical scheme(s2mono) ytitle("Predicted Prob. of Civilian Victimization") citype(logit) ylabel(0(0.2)1) yscale(range(0(0.2)1)) byopts(title("(b) War Aims Temporal Interactions"))
addplot 1: , xlabel(1 "Rebellion" 2 "Annexation") norescaling
addplot 2: , xlabel(1 "Rebellion" 2 "Annexation") norescaling

* figure 2c — military professionalism *
logit civtarget warstrat comident  setcolon indirectcolon waraims lawshare democ7 c.milprof capstate logdur i.post17 i.post17#c.milprof if colonial==1, robust cluster(warid)
margins, at(milprof=(2 (0.5) 11) post17=(0 1)  waraims=(1) warstrat=(0) comident=(1) indirectcolon=(1) waraims=(1) democ7=(0)) atmeans post

marginsplot, scheme(s2mono) ylabel(0(0.2)1) yscale(range(0(0.2)1)) title("(c) Military Professionalism Temporal Interactions") ytitle("Predicted Prob. of Civilian Victimization") xtitle("Military Professionalism") legend(order(1 "Pre-1917" 2 "Post-1917"))
